var buffer1 = Buffer.from('G');
var buffer2 = Buffer.from('ABCD');
var result = buffer1.compare(buffer2);

//1,0,-1
console.log('比较结果：'+result);
if(result < 0) {
    console.log(buffer1 + " 在 " + buffer2 + "之前");
}else if(result == 0){
    console.log(buffer1 + " 与 " + buffer2 + "相同");
}else {
    console.log(buffer1 + " 在 " + buffer2 + "之后");
}
